<?php
require 'user.php';
require 'function.php';
if((is_dir($path=_decode($_GET['path']))==false)) {
header('Content-Type: text/html; charset=UTF-8');
echo <<<HTML
Error：404
HTML;
exit;
}
header('Content-Type: text/html; charset=UTF-8');
echo <<<HTML
<html>
<head>
<title>SVN  创建分支</title>
<style type="text/css">
.big_board{background-color:#009BCE;color:#FFF;}
.board_title{margin-bottom:1px;border:1px solid #09F;}
</style>
</head>
<body>
<div class="big_board"><div class="board_title">爱特文管－路径信息</div></div>
HTML;
echo '<a href="index.php?path='.$_GET['path'].'">'.realpath($path).'</a>';
if($_POST['go']!=null) {
echo <<<HTML
<div class="big_board"><div class="board_title">爱特文管－系统提示</div></div>
HTML;
file_put_contents($f="data/m.".session_id().".txt",$_POST['m']);
$m=escapeshellarg(svnpath($f));
$url=escapeshellarg($_POST["url"]);
$url2=escapeshellarg($_SESSION["svnurl"]=$_POST["url2"]);
$cmd="svn cp $url $url2 -F $m --encoding=utf-8 $_SESSION[key]";
echo htmlcode(cmd($cmd));
}
echo <<<HTML
<div class="big_board"><div class="board_title">SVN  分支路径</div></div>
HTML;
echo '<form action="'.$_SERVER['PHP_SELF'].'?path='.$_GET['path'].'" method="post">';
echo '原URL:<input name="url" value="'.htmlspecialchars($_SESSION["svnurl"]).'"/><br/>';
echo '目标URL:<input name="url2" value="'.htmlspecialchars($_SESSION["svnurl"]).'"/><br/>';
echo '日志信息:<br/><textarea name="m" rows="'.$_SESSION['editset']['size'][0].'" cols="'.$_SESSION['editset']['size'][1].'"/>'.htmlcode(file_get_contents("data/m.".session_id().".txt"),true).'</textarea><br/>';
echo '<input type="submit" name="go" value="提交"/><br/>（可能会连接超时。如果超时，<a href="status.php?path='.$_GET['path'].'&amp;onlyshow=1">点击这里查看提交结果</a>）';
echo '</form>';
echo <<<HTML

<div class="big_board"><div class="board_title">By：Admin@Lspecial.Com</div></div>
</body>
</html>
HTML;
?>